package com.maila.simplerecord.utils;

import android.app.Activity;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.view.View;

import com.maila.simplerecord.activity.ImagePagerActivity;

import java.io.Serializable;
import java.util.List;


/**
 * Created by ld_srg on 2016/4/14.
 */
public class ImgBrower {

    public static void getImageBrower(Context mcontext, int position, List<String> urls2, String title, View view) {

        Intent intent = new Intent(mcontext, ImagePagerActivity.class);
        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, (Serializable) urls2);
        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, position);
        intent.putExtra(ImagePagerActivity.EXTRA_CAREER_TITLE, title);
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
            mcontext.startActivity(intent, ActivityOptions.makeSceneTransitionAnimation((Activity) mcontext, view, "photo").toBundle());
        } else {
            mcontext.startActivity(intent);
        }
    }
}
